package com.ease.core.components {
   import flash.events.MouseEvent;

   import mx.controls.ProgressBar;
   import mx.controls.ProgressBarLabelPlacement;
   import mx.controls.ProgressBarMode;

   public class StageProgressBar extends ProgressBar {
      public function StageProgressBar() {
         //trackHeight="20" width="120" indeterminate="true" mode="manual"
         //						labelPlacement="center" label="ProgressBar"
         super();
         this.setStyle("trackHeight", 20);
         this.width = 120;
         //this.percentWidth=100;
         this.labelPlacement = ProgressBarLabelPlacement.CENTER;
         this.label = "";
         this.indeterminate = true;
         this.addEventListener(MouseEvent.CLICK, onMouseClick);
         stop();
      }

      private function onMouseClick(event:MouseEvent):void {
         if (this.mode == ProgressBarMode.EVENT) {
            this.mode = ProgressBarMode.MANUAL;
         }
         else {
            this.mode = ProgressBarMode.EVENT;
         }
      }

      public function start():void {
         this.mode = ProgressBarMode.EVENT;
      }

      public function stop():void {
         this.mode = ProgressBarMode.MANUAL;
      }
   }
}